POST
/
1
/
indexes
/
{indexName}
/
{model}
/
recommend
/
rules
/
search
// Initialize the client
var client = new RecommendClient(
  new RecommendConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);

// Call the API
var response = await client.SearchRecommendRulesAsync(
  "<YOUR_INDEX_NAME>",
  Enum.Parse<RecommendModels>("RelatedProducts")
);
// >LOG
{
  "hits": [
    {
      "_metadata": {
        "lastUpdate": "2023-07-04T12:49:15Z"
      },
      "objectID": "<string>",
      "condition": {
        "filters": "(category:Book OR category:Ebook) AND _tags:published",
        "context": "mobile"
      },
      "consequence": {
        "hide": [
          {
            "objectID": "test-record-123"
          }
        ],
        "promote": [
          {
            "objectID": "test-record-123",
            "position": 1
          }
        ],
        "params": {
          "automaticFacetFilters": [
            {
              "facet": "<string>",
              "negative": true
            }
          ],
          "filters": "(category:Book OR category:Ebook) AND _tags:published",
          "optionalFilters": [
            "category:books<score=1>",
            "category:-movies<score=1>"
          ]
        }
      },
      "description": "Boost on-sale items",
      "enabled": true,
      "validity": [
        {
          "from": 123,
          "until": 123
        }
      ]
    }
  ],
  "nbHits": 20,
  "page": 0,
  "nbPages": 1
}

Authorizations

x-algolia-application-id
string
header
required

Your Algolia application ID.

x-algolia-api-key
string
header
required

Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.

Path Parameters

indexName
string
required

Name of the index on which to perform the operation.

Example:

"ALGOLIA_INDEX_NAME"

model
enum<string>
required
Available options:
related-products,
bought-together,
trending-facets,
trending-items

Body

application/json

Recommend rules parameters.

Response

200
application/json

OK

The response is of type object.